package com.apobates.jforum2.troll.nest.service;

import com.apobates.jforum2.threads.stub.TopicCommonResponseVo;
import com.apobates.jforum2.threads.stub.vo.ThreadsAlbumPictureRecordVo;
import com.apobates.jforum2.threads.stub.vo.ThreadsAlbumPictureVo;
import com.apobates.jforum2.threads.stub.vo.ThreadsAlbumVo;
import com.apobates.jforum2.threads.stub.vo.ThreadsCategoryVo;
import com.apobates.jforum2.threads.stub.vo.ThreadsCollectStatsVo;
import com.apobates.jforum2.threads.stub.vo.ThreadsConfigVo;
import com.apobates.jforum2.threads.stub.vo.ThreadsStatsVo;
import com.apobates.jforum2.threads.stub.vo.ThreadsTagRelateVo;
import com.apobates.jforum2.threads.stub.vo.ThreadsTagVo;
import com.apobates.jforum2.threads.stub.vo.ThreadsVo;
import com.apobates.jforum2.troll.nest.FrontFeignClientConfig;
import com.apobates.jforum2.troll.nest.service.TopicClient.TopicFallbackFactory;
import com.apobates.jforum2.troll.utils.core.EntityPageResult;
import java.util.Collections;
import java.util.List;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 话题服务客户端
 * @author xiaofanku
 * @since 20210413
 */
@FeignClient(value="TROLL-GATEWAY",
            contextId="topicClient",
            fallbackFactory=TopicFallbackFactory.class,
            configuration = FrontFeignClientConfig.class
)
@RequestMapping(value="/topic")
public interface TopicClient {
    //1:查看指定的话题
    @GetMapping("/{id}")
    ResponseEntity<ThreadsVo> get(@PathVariable("id") long topicId);
    
    //2:浏览话题
    @PutMapping(value="/{id}/browse", consumes="application/x-www-form-urlencoded")
    ResponseEntity<String> browse(@PathVariable("id") long topicId,
                     @RequestParam("member") long memberId,
                     @RequestParam("nickname") String memberNickname,
                     @RequestParam("token") String token,
                     @RequestParam("ip") String ipAddr);
    
    //3:改由Nest实现
    
    //4:查看指定版块下的指定类型的话题,不包括删除;级联加载话题统计
    @GetMapping("/board/{board}/{category}/{page}/{number}")
    EntityPageResult<ThreadsCollectStatsVo> getAll(
            @PathVariable("board")long boardId,
            @PathVariable(value="category", required=true)String categoryValue,
            @PathVariable("page")int page,
            @PathVariable("number")int pageSize);
    
    //5:查看指定版块组最近发布的话题,方法将级联加载话题统计
    @GetMapping("/volume/{volume}/recent")
    List<ThreadsCollectStatsVo> getRecent(@PathVariable("volume") int boardGroupId, @RequestParam("size") int showSize);
    
    //6:查看指定版块组(卷)下的最多回复的话题
    @GetMapping("/volume/{volume}/maxreply")
    List<ThreadsVo> getMaxReplyForBoardGroup(@PathVariable("volume") int boardGroupId, @RequestParam("size")int showSize);
    
    //7:查看指定版块组(卷)下的精华话题
    @GetMapping("/volume/{volume}/good")
    List<ThreadsVo> getGoodsForBoardGroup(@PathVariable("volume") int boardGroupId, @RequestParam("size") int showSize);
    
    //8:查看回复最多的话题
    @GetMapping("/stats/maxreply")
    List<ThreadsVo> getHot(@RequestParam("size")int showSize);
    
    //9:指定版块置顶的话题,不包括删除;会级联加载话题统计,最多显示5条
    @GetMapping("/board/{board}/top")
    List<ThreadsCollectStatsVo> getTopForBoard(@PathVariable("board") long boardId);
    
    //10:自参考日期以后版块最近的话题,会级联加载话题统计
    @GetMapping("/board/{board}/recent/{stamp}")
    List<ThreadsCollectStatsVo> getRecentByUnixStamp(@PathVariable("board")long boardId, @PathVariable("stamp")int previousUx);
    
    //11:自参考日期以后版块最近的话题数量
    @GetMapping("/board/{board}/recent/{stamp}/size")
    long getRecentByUnixStampSize(@PathVariable("board")long boardId, @PathVariable("stamp")int previousUx);
    
    //12:查看最近发布的话题,不包括删除的,不包含举报和反馈类型的.方法会级联加载话题统计({版块}改由Nest补正)
    @GetMapping("/home/recent")
    List<ThreadsCollectStatsVo> getRecentRelateContent(@RequestParam("size") int showSize);
    
    //13:查看指定的话题,加载话题的统计信息({会员信息|话题内容}改由Nest补正)
    @GetMapping("/{id}/cascade/stats")
    ResponseEntity<ThreadsCollectStatsVo> getCaseStats(@PathVariable("id")long topicId);
    
    //14:改由Nest实现
    
    //15:查看指定会员发布的所有话题,会级联加载话题统计
    @GetMapping("/member/recent/{member}/{page}/{number}")
    EntityPageResult<ThreadsCollectStatsVo> getAllForMember(@PathVariable("member") long memberId, @PathVariable("page") int page, @PathVariable("number") int pageSize);

    //15.1:查看会员回复的话题,话题的作者不是该会员(不包含自已发的),会级联加载话题的统计
    //@GetMapping("/member/reply/{member}/{page}/{number}")
    //public EntityPageResult<ThreadsCollectStatsVo> getAllForMemberReply(@PathVariable("member") long memberId, @PathVariable("page") int page, @PathVariable("number") int pageSize);
    
    //16:查看指定会员最近回复的话题,话题的作者不是该会员(不包含自已发的),级联加载版块
    //getAllForMemberReply
    @GetMapping("/member/reply/{member}")
    List<ThreadsVo> getRecentReplyForMember(@PathVariable("member") long memberId, @RequestParam("size") int showSize);
    
    //17:查看指定会员最近发布的话题({版块}改由Nest补正)
    @GetMapping("/member/recent/{member}")
    List<ThreadsVo> getRecentForMember(@PathVariable("member") long memberId, @RequestParam("size") int showSize);
    
    //18:查看会员发布的受欢迎的话题列表级联加载话题统计({版块}改由Nest补正)
    @GetMapping("/member/popular/{member}")
    List<ThreadsCollectStatsVo> getAllForMemberPopular(@PathVariable("member") long memberId, @RequestParam("size") int showSize);
    
    //19:查看指定版块最近的话题,不包括删除,置顶;包括加精,普通;以rankingDateTime倒序 服务于RSS
    @GetMapping("/rss/recent/board/{board}")
    List<ThreadsVo> getRecentForBoard(@PathVariable("board") long boardId, @RequestParam("size") int showSize);
    
    //20:查看最近发布的话题,不包括删除的,不包含1号(举报和反馈所在)版块的
    //RSS
    @GetMapping("/rss/recent")
    List<ThreadsVo> getRecent(@RequestParam("size") int showSize);
    
    //21:根据话题查看话题配置
    @GetMapping("/{id}/config")
    ResponseEntity<ThreadsConfigVo> getConfig(@PathVariable("id") long topicId);
    
    //22:查看话题的统计
    @GetMapping("/{id}/stats")
    ResponseEntity<ThreadsStatsVo> getStats(@PathVariable("id") long topicId);
    
    //23查看指定话题的封面
    @GetMapping("/{id}/cover/{scale}")
    ResponseEntity<String> getCover(@PathVariable("id") long topicId, @PathVariable("scale") String scale);
    
    //24:是否可以收藏, 可以返回true
    @GetMapping("/{id}/favorite/member/{member}")
    boolean isFavorite(@PathVariable("id") long topicId, @PathVariable("member") long memberId);
    
    //25:是否可以点赞, 可以返回true
    @GetMapping("/{id}/like/member/{member}")
    boolean isLike(@PathVariable("id") long topicId, @PathVariable("member") long memberId);
    
    //26:联合检查:
    // 1)是否可以收藏, 可以返回true
    // 2)是否可以点赞, 可以返回true
    
    //27=55
    
    //28:反馈
    @PostMapping(value="/feedback", consumes="application/x-www-form-urlencoded")
    ResponseEntity<ThreadsVo> feedback(@RequestParam("title") String title,
                  @RequestParam("content") String content,
                  @RequestParam("member") long memberId,
                  @RequestParam("nickname") String memberNickname,
                  @RequestParam("token") String token,
                  @RequestParam("ip") String ipAddr);
    //29:移动话题
    @PutMapping(value="/{id}/move", consumes="application/x-www-form-urlencoded")
    ResponseEntity<String> move(@PathVariable("id") long topicId,
                    @RequestParam("board") long srcBoardId,
                    @RequestParam("target") long targetBoardId,
                    @RequestParam("targetBoardGroup") int targetBoardGroupId,
                    @RequestParam("member") long memberId,
                    @RequestParam("nickname") String memberNickname,
                    @RequestParam("token") String token,
                    @RequestParam("ip") String ipAddr);
    //30:创建话题
    @PostMapping(value="/create", consumes="application/x-www-form-urlencoded")
    ResponseEntity<ThreadsVo> create(@RequestParam("volume") int volumesId,
                      @RequestParam("board") long boardId,
                      @RequestParam("category") int category,
                      @RequestParam("title") String title,
                      @RequestParam("content") String content,
                      @RequestParam("member") long memberId,
                      @RequestParam("nickname") String memberNickname,
                      @RequestParam("anony") String isAnonyStr,
                      @RequestParam("token") String token,
                      @RequestParam("ip") String ipAddr);
    
    /**
     * 31:查看指定版块最近的话题, 忽略状态;以entryDateTime倒序 服务于策略检查
     * @param boardId 版块ID
     * @param showSize 显示的数量
     * @return
     */
    @GetMapping("/board/{board}/recent")
    List<ThreadsVo> getRecentForBoardIgnoreStatus(@PathVariable("board") long boardId, @RequestParam("size") int showSize);
    
    //32:查看版块话题可用的话题类型列表. 注意版块必须与版块组(卷)是包含关系
    @GetMapping("/category/{board}/{volume}")
    List<ThreadsCategoryVo> getAllByBoardTopicCategories(@PathVariable("board")long boardId, @PathVariable("volume") int boardGroupId);
    
    //33:置顶话题
    @PutMapping(value="/{id}/top", consumes="application/x-www-form-urlencoded")
    boolean toped(@PathVariable("id") long topicId,
            @RequestParam("member") long memberId,
            @RequestParam("nickname") String memberNickname,
            @RequestParam("token") String token,
            @RequestParam("ip") String ipAddr);
    
    //34:精华话题
    @PutMapping(value="/{id}/good", consumes="application/x-www-form-urlencoded")
    boolean gooded(@PathVariable("id") long topicId,
             @RequestParam("member") long memberId,
             @RequestParam("nickname") String memberNickname,
             @RequestParam("token") String token,
             @RequestParam("ip") String ipAddr);
    
    //35:锁定话题
    @PutMapping(value="/{id}/lock", consumes="application/x-www-form-urlencoded")
    boolean locked(@PathVariable("id") long topicId,
             @RequestParam("member") long memberId,
             @RequestParam("nickname") String memberNickname,
             @RequestParam("token") String token,
             @RequestParam("ip") String ipAddr);
    
    //36:取消锁定
    @PutMapping(value="/{id}/lock/cancel", consumes="application/x-www-form-urlencoded")
    boolean unLocked(@PathVariable("id") long topicId,
              @RequestParam("member") long memberId,
              @RequestParam("nickname") String memberNickname,
              @RequestParam("token") String token,
              @RequestParam("ip") String ipAddr);
    
    //37:删除话题
    @PutMapping(value="/{id}/remove", consumes="application/x-www-form-urlencoded")
    boolean dele(@PathVariable("id") long topicId,
            @RequestParam("member") long memberId,
            @RequestParam("nickname") String memberNickname,
            @RequestParam("token") String token,
            @RequestParam("ip") String ipAddr);
    
    //38:收藏话题
    @PutMapping(value="/{id}/favorite", consumes="application/x-www-form-urlencoded")
    boolean favorited(@PathVariable("id") long topicId,
               @RequestParam("member") long memberId,
               @RequestParam("nickname") String memberNickname,
               @RequestParam("token") String token,
               @RequestParam("ip") String ipAddr);
    
    //39:取消收藏
    @PutMapping(value="/{id}/favorite/cancel", consumes="application/x-www-form-urlencoded")
    boolean cancelFavorited(@PathVariable("id") long topicId,
                  @RequestParam("member") long memberId,
                  @RequestParam("nickname") String memberNickname,
                  @RequestParam("token") String token,
                  @RequestParam("ip") String ipAddr);
    
    //40:话题点赞
    @PutMapping(value="/{id}/like", consumes="application/x-www-form-urlencoded")
    boolean liked(@PathVariable("id") long topicId,
            @RequestParam("member") long memberId,
            @RequestParam("nickname") String memberNickname,
            @RequestParam("token") String token,
            @RequestParam("ip") String ipAddr);
    
    //41:取消话题点赞
    @PutMapping(value="/{id}/like/cancel", consumes="application/x-www-form-urlencoded")
    boolean unLiked(@PathVariable("id") long topicId,
             @RequestParam("member") long memberId,
             @RequestParam("nickname") String memberNickname,
             @RequestParam("token") String token,
             @RequestParam("ip") String ipAddr);
    
    //42:查看指定像册的图片
    @PostMapping(value="/album/picture/multi", consumes="application/x-www-form-urlencoded")
    List<ThreadsAlbumPictureVo> getMultiAlbumPicture(@RequestParam("records") String albumIdString,
                                @RequestParam("scale") String scale,
                                @RequestParam("default_value") String defaultValue);
    
    //43:查看指定话题的像册
    @PostMapping(value="/album/multi", consumes="application/x-www-form-urlencoded")
    List<ThreadsAlbumVo> getMultiCover(@RequestParam("records") String topicIdString,
                            @RequestParam("scale") String scale,
                            @RequestParam("default_value") String defaultValue);
    
    //44:查看指定的像册
    @GetMapping("/album/{album}")
    ResponseEntity<ThreadsAlbumVo> getAlbum(@PathVariable("album")long albumId);
    
    //45:查看指定像册下的图片
    @PostMapping(value="/album/{album}/pictures", consumes="application/x-www-form-urlencoded")
    List<ThreadsAlbumPictureRecordVo> getAlbumPictures(
            @PathVariable("album")long albumId,
            @RequestParam("scale") String scale,
            @RequestParam("default_value") String defaultValue,
            @RequestParam("size") int showSize);
    
    //46:查看举报的类别
    @GetMapping("/report/category")
    List<TopicCommonResponseVo> getReportType();
    
    //47:根据标签查看相关的话题
    @GetMapping("/search/{word}/{page}/{number}")
    EntityPageResult<ThreadsVo> getAllForTag(@PathVariable("word")String searchWord, @PathVariable("page")int page, @PathVariable("number")int pageSize);
    
    //48:查看指定话题相关的话题
    @GetMapping("/{id}/relate")
    List<ThreadsTagRelateVo> getRelated(@PathVariable("id") long topicId, @RequestParam("size") int showSize);
    
    //49:查看指定话题的标签
    @GetMapping("/{id}/tag")
    List<ThreadsTagVo> getTag(@PathVariable("id")long topicId);
    
    //50:创建话题标签
    @PostMapping(value="/{id}/tag/create", consumes="application/x-www-form-urlencoded")
    ResponseEntity<ThreadsTagVo> createTag(@PathVariable("id")long topicId,
                              @RequestParam("tag")String tagNames,
                              @RequestParam("segment")String tagSegment,
                              @RequestParam("member") long memberId,
                              @RequestParam("nickname") String memberNickname,
                              @RequestParam("token") String token,
                              @RequestParam("ip") String ipAddr);
    
    //51:从话题中删除指定标签
    @PostMapping(value="/tag/{id}/remove", consumes="application/x-www-form-urlencoded")
    boolean removeTag(@PathVariable("id")long tagId,
                   @RequestParam("threads")long topicId,
                   @RequestParam("member") long memberId,
                   @RequestParam("nickname") String memberNickname,
                   @RequestParam("token") String token,
                   @RequestParam("ip") String ipAddr);
    
    //52:分组统计出现频率最高的标签名称(TopicTag.names)
    @GetMapping("/tag/hot")
    List<TopicCommonResponseVo> groupTagForNames(@RequestParam("size")int showSize);
    
    //55:举报话题/回复
    @PostMapping(value="/{id}/report", consumes="application/x-www-form-urlencoded")
    ResponseEntity<ThreadsVo> report(@PathVariable("id") long topicId,
                       @RequestParam("reason") String reportReason,
                       @RequestParam("type") int reportType,
                       @RequestParam("destFloor")long reportFloor,
                       @RequestParam("destNickname")String reportNickname,
                       @RequestParam("destLink")String reportLink,
                       @RequestParam("destContent")String reportSourceContent,
                       @RequestParam("member") long memberId,
                       @RequestParam("nickname") String memberNickname,
                       @RequestParam("token") String token,
                       @RequestParam("ip") String ipAddr);
    @Component
    static class TopicFallbackFactory implements FallbackFactory<TopicClientFallback> {
        @Override
        public TopicClientFallback create(Throwable cause) {
            return new TopicClientFallback();
        }
    }
    
    static class TopicClientFallback implements TopicClient{
        
        @Override
        public ResponseEntity<ThreadsVo> get(long topicId) {
            return ResponseEntity.notFound().build();
        }
        
        @Override
        public List<ThreadsVo> getRecentForBoardIgnoreStatus(long boardId, int showSize) {
            return Collections.emptyList();
        }
        
        @Override
        public ResponseEntity<String> move(long topicId, long srcBoardId, long targetBoardId, int targetBoardGroupId, long memberId, String memberNickname, String token, String ipAddr) {
            return ResponseEntity.notFound().build();
        }

        @Override
        public ResponseEntity<String> browse(long topicId, long memberId, String memberNickname, String token, String ipAddr) {
            return ResponseEntity.notFound().build();
        }

        @Override
        public List<ThreadsVo> getMaxReplyForBoardGroup(int boardGroupId, int showSize) {
            return Collections.emptyList();
        }

        @Override
        public List<ThreadsVo> getGoodsForBoardGroup(int boardGroupId, int showSize) {
            return Collections.emptyList();
        }

        @Override
        public List<ThreadsVo> getHot(int showSize) {
            return Collections.emptyList();
        }

        @Override
        public long getRecentByUnixStampSize(long boardId, int previousUx) {
            return -1L;
        }

        @Override
        public List<ThreadsVo> getRecentForBoard(long boardId, int showSize) {
            return Collections.emptyList();
        }

        @Override
        public List<ThreadsVo> getRecent(int showSize) {
            return Collections.emptyList();
        }

        @Override
        public ResponseEntity<ThreadsConfigVo> getConfig(long topicId) {
            return ResponseEntity.notFound().build();
        }

        @Override
        public ResponseEntity<ThreadsStatsVo> getStats(long topicId) {
            return ResponseEntity.notFound().build();
        }

        @Override
        public ResponseEntity<String> getCover(long topicId, String scale) {
            return ResponseEntity.notFound().build();
        }

        @Override
        public boolean isFavorite(long topicId, long memberId) {
            return false;
        }

        @Override
        public boolean isLike(long topicId, long memberId) {
            return false;
        }

        @Override
        public ResponseEntity<ThreadsVo> create(int volumesId, long boardId, int category, String title, String content, long memberId, String memberNickname, String isAnonyStr, String token, String ipAddr) {
            return ResponseEntity.notFound().build();
        }

        @Override
        public boolean toped(long topicId, long memberId, String memberNickname, String token, String ipAddr) {
            return false;
        }

        @Override
        public boolean gooded(long topicId, long memberId, String memberNickname, String token, String ipAddr) {
            return false;
        }

        @Override
        public boolean locked(long topicId, long memberId, String memberNickname, String token, String ipAddr) {
            return false;
        }

        @Override
        public boolean unLocked(long topicId, long memberId, String memberNickname, String token, String ipAddr) {
            return false;
        }

        @Override
        public boolean dele(long topicId, long memberId, String memberNickname, String token, String ipAddr) {
            return false;
        }

        @Override
        public boolean favorited(long topicId, long memberId, String memberNickname, String token, String ipAddr) {
            return false;
        }

        @Override
        public boolean cancelFavorited(long topicId, long memberId, String memberNickname, String token, String ipAddr) {
            return false;
        }

        @Override
        public boolean liked(long topicId, long memberId, String memberNickname, String token, String ipAddr) {
            return false;
        }

        @Override
        public boolean unLiked(long topicId, long memberId, String memberNickname, String token, String ipAddr) {
            return false;
        }

        @Override
        public List<ThreadsAlbumPictureVo> getMultiAlbumPicture(String albumIdString, String scale, String defaultValue) {
            return Collections.emptyList();
        }

        @Override
        public List<ThreadsAlbumVo> getMultiCover(String topicIdString, String scale, String defaultValue) {
            return Collections.emptyList();
        }

        @Override
        public ResponseEntity<ThreadsAlbumVo> getAlbum(long albumId) {
            return ResponseEntity.notFound().build();
        }

        @Override
        public List<ThreadsAlbumPictureRecordVo> getAlbumPictures(long albumId, String scale, String defaultValue, int showSize) {
            return Collections.emptyList();
        }

        @Override
        public List<TopicCommonResponseVo> getReportType() {
            return Collections.emptyList();
        }

        @Override
        public EntityPageResult<ThreadsVo> getAllForTag(String searchWord, int page, int pageSize) {
            return EntityPageResult.empty(1);
        }

        @Override
        public List<ThreadsTagRelateVo> getRelated(long topicId, int showSize) {
            return Collections.emptyList();
        }

        @Override
        public List<ThreadsTagVo> getTag(long topicId) {
            return Collections.emptyList();
        }

        @Override
        public boolean removeTag(long tagId, long topicId, long memberId, String memberNickname, String token, String ipAddr) {
            return false;
        }

        @Override
        public List<TopicCommonResponseVo> groupTagForNames(int showSize) {
            return Collections.emptyList();
        }

        @Override
        public ResponseEntity<ThreadsVo> report(long topicId, String reportReason, int reportType, long reportFloor, String reportNickname, String reportLink, String reportSourceContent, long memberId, String memberNickname, String token, String ipAddr) {
            return ResponseEntity.notFound().build();
        }

        @Override
        public List<ThreadsCollectStatsVo> getRecent(int boardGroupId, int showSize) {
            return Collections.emptyList();
        }

        @Override
        public List<ThreadsCollectStatsVo> getTopForBoard(long boardId) {
            return Collections.emptyList();
        }

        @Override
        public List<ThreadsCollectStatsVo> getRecentByUnixStamp(long boardId, int previousUx) {
            return Collections.emptyList();
        }

        @Override
        public List<ThreadsCollectStatsVo> getRecentRelateContent(int showSize) {
            return Collections.emptyList();
        }

        @Override
        public ResponseEntity<ThreadsCollectStatsVo> getCaseStats(long topicId) {
            return ResponseEntity.notFound().build();
        }

        @Override
        public List<ThreadsVo> getRecentReplyForMember(long memberId, int showSize) {
            return Collections.emptyList();
        }

        @Override
        public List<ThreadsVo> getRecentForMember(long memberId, int showSize) {
            return Collections.emptyList();
        }

        @Override
        public List<ThreadsCollectStatsVo> getAllForMemberPopular(long memberId, int showSize) {
            return Collections.emptyList();
        }

        @Override
        public ResponseEntity feedback(String title, String content, long memberId, String memberNickname, String token, String ipAddr) {
            return ResponseEntity.notFound().build();
        }

        @Override
        public List<ThreadsCategoryVo> getAllByBoardTopicCategories(long boardId, int boardGroupId) {
            return Collections.emptyList();
        }

        @Override
        public EntityPageResult<ThreadsCollectStatsVo> getAll(long boardId, String categoryValue, int page, int pageSize) {
            return EntityPageResult.empty(1);
        }

        @Override
        public ResponseEntity<ThreadsTagVo> createTag(long topicId, String tagNames, String tagSegment, long memberId, String memberNickname, String token, String ipAddr) {
            return ResponseEntity.notFound().build();
        }

        @Override
        public EntityPageResult<ThreadsCollectStatsVo> getAllForMember(long memberId, int page, int pageSize) {
            return EntityPageResult.empty(1);
        }
    
    }
}